Require a very simple bash-based webserver for logging XML POST [on hold]
Posted
by
Syffys
on Server Fault
See other posts from Server Fault
or by Syffys
Published on 2014-06-04T15:44:02Z
Indexed on
2014/06/04
21:28 UTC
Read the original article
Hit count: 293
As in title, it's for testing purpose and I need it to be extremely light (1 line to 1 single light file).
Here is a XML query sample:
XML_QUERY=$(cat <<EOF
<?xml version='1.0' encoding='UTF-8'?>
<Test></Test>
EOF
)
curl -H "Content-type: text/xml; charset=utf-8" -H "Soapaction: \"\"" -k -d "${XML_QUERY}" http://localhost:8088
Here are some of the tracks I have found so far even if I wasnt able to adapt them to work as I expect:
- Netcat minimal webserver: Problem is that my nc does not have the -q option, so the connection is closing before delivering the XML content
- Netcat Only webserver: Same as above
Thanks in advance!
EDIT: As it's been asked, I'm running Linux Redhat, even if the distro does not really matter and the OS implied since I'm asking a bash-based solution...
Also about my topic being on hold:
"Instead, describe your situation and the specific problem you're trying to solve" => I though this was exactly what I was doing, but ok I'll reword:
- My situation: bash environment (which can also include some standard linux tool: netcat, python or whatever)
- My specific problem: please see title: Require a very simple bash-based webserver for logging XML in HTTP POST for testing purpose
© Server Fault or respective owner